<?php
namespace model\database;
/**
 * Description of Connector
 *
 * @author Damian
 */
abstract  class Connector extends \library\Base{
    const FETCH_NUM=1;
    const FETCH_ASSOC=2;
    const FETCH_BOTH=3;
    const FETCH_OBJECT=4;
    public function initialize(){
        return $this;
    }
    public abstract function escape($value);
    public abstract function executeSQL($sql);
    public abstract function getLastInsertId($name=null);
    public abstract function getAffectedRows($result=null);
    public abstract function fetch($result,$fetchType=  Connector::FETCH_BOTH,$className="stdClass");
    public function query(){
        return new Query(array(
            "connector" => $this));
    }
}
